﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using MangaManagerLib;
using System.ServiceModel.Activation;

namespace MangaManagerLib
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    [AspNetCompatibilityRequirements(RequirementsMode
    = AspNetCompatibilityRequirementsMode.Allowed)]
    public class MangaService : IMangaService
    {
        public  IList<string> GetDataForChapter(string key, string url)
        {           
            return MangaManager.GetInstance().GetDataForChapter(key, url);
        }
        public MangaStoryDetailContract GetMangaStoryDetail(string key, string url)
        {
            return MangaManager.GetInstance().GetMangaStoryDetail(key, url).ConvertToMangaDetailContract();
        }
        public MangaCollectionContract GetMangaCollection(string key, string url, int page)
        {
            return MangaManager.GetInstance().GetMangaCollection(key, url, page).ConvertToMangaCollectionContract();
        }



        public IList<BriefMangaInfoContract> GetNewestManga(string key, int number)
        {
            return MangaManager.GetInstance().GetNewestManga(key, number).ConvertToListBriefMangaStoryContract();
        }

        public IList<BriefMangaInfoContract> GetPopularManga(string key, int number)
        {
            return MangaManager.GetInstance().GetPopularManga(key, number).ConvertToListBriefMangaStoryContract();
        }

        public IList<BriefMangaInfoContract> SearchMangaByTitle(string key, string keysearch)
        {
            return MangaManager.GetInstance().SearchMangaByTitle(key, keysearch).ConvertToListBriefMangaStoryContract();
        }
    }
}
